<?php
class Zendvn_View_Helper_CmsLinkSort extends Zend_View_Helper_Abstract{
	
	public function cmsLinkSort($label,$col, $action_link,$ssFilter, $icon_Link, $default_sort = 'DESC'){
		
		if($ssFilter['col'] != $col){		
			$sortBy = $default_sort;
			$linkAction  = $action_link . '/col/' . $col . '/by/' . $sortBy;		
			$xhtml = '<a href="' . $linkAction . '">
	                  ' . $label . '</a>';
		}else{
			
			if($ssFilter['order'] == 'DESC'){
				$sortBy = 'ASC';
				$iconSort = $icon_Link . '/arrow_down.png';
				
			}else{
				$sortBy = 'DESC';
				$iconSort = $icon_Link . '/arrow_up.png';
			}
			//$this->baseUrl($this->currentController . '/filter/type/sort');
			$linkAction  = $action_link . '/col/' . $col . '/by/' . $sortBy;
		
			$xhtml = '<a href="' . $linkAction . '">
	                  ' . $label . '<br>
	                  <img src="' . $iconSort . '"></img>
	                  </a>';
		}
		
		
         return $xhtml;              		
	
	}
}